	SUBROUTINE FANGCHA(X,N,XBAR,S,S2)
	IMPLICIT NONE
	INTEGER::N,I
	REAL(4),DIMENSION(N)::X
	REAL(4)::XBAR,S,S2
	XBAR=0
	DO I=1,N
	XBAR=XBAR+X(I)
	END DO
	XBAR=XBAR/N
	S2=0
	DO I=1,N
		S2=S2+(X(I)-XBAR)**2
	END DO
	S2=S2/N
	S=SQRT(S2)
	END
	PROGRAM MAIN
	IMPLICIT NONE
	INTEGER,PARAMETER::N=12*22
	INTEGER::I
	REAL(4),DIMENSION(N)::X
	REAL(4)::XBAR,S,S2
	OPEN(10,FILE='AA2.DAT')
	DO I=1,N
		READ(10,'(F8.2)')X(I)
	END DO
	CLOSE(10)
	CALL FANGCHA(X,N,XBAR,S,S2)
	OPEN(12,FILE='FANGCHA.DAT')
	WRITE(12,'(4X,"XBAR",7X,"S",9X,"S2")')
	WRITE(12,'(3F10.4)')XBAR,S,S2
	CLOSE(12)
	END
